﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace UI.Models
{
    public static class Lists
    {
        public static IList<string> GetTimessToSelect()
        {
            // this list items shoul not be hard coded like this
            return new List<string> { "06:00", "07:20", "08:40" };
        }

        public static List<SelectListItem> GetAllPlayers()
        {
            IList<Domain.Player> players;
            using (Persistent.PlayerRepository playerRepository = new Persistent.PlayerRepository())
            {
                players = playerRepository.All.ToList();
            }
            return players.Select(item => new SelectListItem { Text = item.Name, Value = item.PlayerId.ToString(CultureInfo.InvariantCulture) }).ToList();

        }
    }

}